home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / Transport / tests / dc.C next >
C/C++ Source or Header  |  1991-06-14  |  769b  |  40 lines

  1. #include <iostream.h>
  2. #include <fstream.h>
  3. #include <stdio.h>
  4. #include <osfcn.h>
  5. #include <libc.h>
  6.  
  7. #include "RJS/Transport.h"
  8. #include "RJS/Convert.h"
  9.  
  10. static char buffer [512000];
  11.  
  12. void test(char *name, char *obj)
  13. {
  14.  
  15.   RJS_DECnetAddress server_address(name,RJS_Convert::toInt(obj));
  16.   RJS_DECnetSeqPacket server;
  17.  
  18. //  cout << server_address.ss_message() << endl;
  19.    fstream bin_file("testing",ios::out);
  20.  
  21.   server.active(server_address);
  22.   server.linger();
  23.   int tot=server.read(buffer,512000);        // read from server
  24.  
  25.   bin_file.write(buffer,tot);
  26.  
  27.   cout << "client: read ==> '" << tot << "'" << endl;
  28.  
  29. }
  30.  
  31. int main(int argc, char *argv[]) 
  32. {
  33.   if (argc!=3) {
  34.     cout<< "usage: " << argv[0] << "host object " << endl;
  35.     exit(1);
  36.   }
  37.   test(argv[1],argv[2]);
  38.   exit(0);
  39. }
  40.